﻿using Abp.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;

namespace pandx.Mulan.Extensions
{
    public static class ObjectExtensions
    {
        public static string ObjectToJson(this object _object)
        {
            var settings = new JsonSerializerSettings
            {
                ContractResolver = new AbpCamelCasePropertyNamesContractResolver(),
                DateFormatString = "yyyy-MM-dd HH:mm:ss"
            };
            return JsonConvert.SerializeObject(_object, settings);
        }
    }
}
